package com.ruoyi.employee.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 合同管理对象 hr_contract
 *
 * @author h……
 * @date 2025-10-19
 */
public class HrContract extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 员工 */
    @Excel(name = "员工")
    private Long empId;

    /** 公司 */
    @Excel(name = "公司")
    private Long companyId;

    /** 部门 */
    @Excel(name = "部门")
    private Long deptId;

    /** 岗位 */
    @Excel(name = "岗位")
    private Long postId;

    /** 合同编号 */
    @Excel(name = "合同编号")
    private String contractNo;

    /** 合同类型（字典） */
    @Excel(name = "合同类型", dictType = "hr_contract_type")
    private String contractType;

    /** 合同甲方 */
    @Excel(name = "合同甲方")
    private String partyA;

    /** 合同期限（年） */
    @Excel(name = "合同期限(年)")
    private Integer termYears;

    /** 是否无固定期限：0否 1是 */
    @Excel(name = "无固定期限", readConverterExp = "0=否,1=是")
    private Integer isIndefinite;

    /** 签订次数（续签+1） */
    @Excel(name = "签订次数")
    private Integer signTimes;

    /** 签订开始 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签订开始", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 签订结束（无固定期限可为空） */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签订结束", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /** 试用期到期（计划） */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "试用期到期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date probationEnd;

    /** 试用期提前提醒天数（默认7） */
    @Excel(name = "试用期提醒天数")
    private Integer remindDaysProbation;

    /** 合同到期提前提醒天数（默认60） */
    @Excel(name = "到期提醒天数")
    private Integer remindDaysContract;

    /** 合同附件地址 */
    @Excel(name = "合同附件地址")
    private String attachment;

    /** 合同状态：0生效中 1终止 2已到期（字典） */
    @Excel(name = "合同状态", dictType = "hr_contract_status")
    private String status;

    /** 逻辑删除：0存在 1删除 */
    private String delFlag;

    /** 工号（hr_employee.emp_no） */
    @Excel(name = "工号")
    private String empNo;

    /** 姓名（hr_employee.name） */
    @Excel(name = "姓名")
    private String empName;

    /** 公司名称（sys_dept.dept_name） */
    @Excel(name = "公司名称")
    private String companyName;

    /** 部门名称（sys_dept.dept_name） */
    @Excel(name = "部门名称")
    private String deptName;

    /** 岗位名称（sys_post.post_name 或自建岗位名） */
    @Excel(name = "岗位名称")
    private String postName;

    /** 期限说明（如“无固定期限”或“X年”） */
    @Excel(name = "期限说明")
    private String termText;

    /* ========== Getter / Setter ========== */

    public void setId(Long id) { this.id = id; }
    public Long getId() { return id; }

    public void setEmpId(Long empId) { this.empId = empId; }
    public Long getEmpId() { return empId; }

    public void setCompanyId(Long companyId) { this.companyId = companyId; }
    public Long getCompanyId() { return companyId; }

    public void setDeptId(Long deptId) { this.deptId = deptId; }
    public Long getDeptId() { return deptId; }

    public void setPostId(Long postId) { this.postId = postId; }
    public Long getPostId() { return postId; }

    public void setContractNo(String contractNo) { this.contractNo = contractNo; }
    public String getContractNo() { return contractNo; }

    public void setContractType(String contractType) { this.contractType = contractType; }
    public String getContractType() { return contractType; }

    public void setPartyA(String partyA) { this.partyA = partyA; }
    public String getPartyA() { return partyA; }

    public void setTermYears(Integer termYears) { this.termYears = termYears; }
    public Integer getTermYears() { return termYears; }

    public void setIsIndefinite(Integer isIndefinite) { this.isIndefinite = isIndefinite; }
    public Integer getIsIndefinite() { return isIndefinite; }

    public void setSignTimes(Integer signTimes) { this.signTimes = signTimes; }
    public Integer getSignTimes() { return signTimes; }

    public void setStartDate(Date startDate) { this.startDate = startDate; }
    public Date getStartDate() { return startDate; }

    public void setEndDate(Date endDate) { this.endDate = endDate; }
    public Date getEndDate() { return endDate; }

    public void setProbationEnd(Date probationEnd) { this.probationEnd = probationEnd; }
    public Date getProbationEnd() { return probationEnd; }

    public void setRemindDaysProbation(Integer remindDaysProbation) { this.remindDaysProbation = remindDaysProbation; }
    public Integer getRemindDaysProbation() { return remindDaysProbation; }

    public void setRemindDaysContract(Integer remindDaysContract) { this.remindDaysContract = remindDaysContract; }
    public Integer getRemindDaysContract() { return remindDaysContract; }

    public void setAttachment(String attachment) { this.attachment = attachment; }
    public String getAttachment() { return attachment; }

    public void setStatus(String status) { this.status = status; }
    public String getStatus() { return status; }

    public void setDelFlag(String delFlag) { this.delFlag = delFlag; }
    public String getDelFlag() { return delFlag; }

    public String getEmpNo() { return empNo; }
    public void setEmpNo(String empNo) { this.empNo = empNo; }

    public String getEmpName() { return empName; }
    public void setEmpName(String empName) { this.empName = empName; }

    public String getCompanyName() { return companyName; }
    public void setCompanyName(String companyName) { this.companyName = companyName; }

    public String getDeptName() { return deptName; }
    public void setDeptName(String deptName) { this.deptName = deptName; }

    public String getPostName() { return postName; }
    public void setPostName(String postName) { this.postName = postName; }

    public String getTermText() { return termText; }
    public void setTermText(String termText) { this.termText = termText; }

    /* ========== toString ========== */

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("empId", getEmpId())
                .append("companyId", getCompanyId())
                .append("deptId", getDeptId())
                .append("postId", getPostId())
                .append("contractNo", getContractNo())
                .append("contractType", getContractType())
                .append("partyA", getPartyA())
                .append("termYears", getTermYears())
                .append("isIndefinite", getIsIndefinite())
                .append("signTimes", getSignTimes())
                .append("startDate", getStartDate())
                .append("endDate", getEndDate())
                .append("probationEnd", getProbationEnd())
                .append("remindDaysProbation", getRemindDaysProbation())
                .append("remindDaysContract", getRemindDaysContract())
                .append("attachment", getAttachment())
                .append("status", getStatus())
                .append("remark", getRemark())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("delFlag", getDelFlag())
                // 联表展示字段
                .append("empNo", getEmpNo())
                .append("empName", getEmpName())
                .append("companyName", getCompanyName())
                .append("deptName", getDeptName())
                .append("postName", getPostName())
                .append("termText", getTermText())
                .toString();
    }
}
